package ldkxingzhe.l365calendar.activity;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Vibrator;

import ldkxingzhe.l365calendar.R;

/**
 * 提醒Ｄｉａｌｏｇ
 * Created by ke on 16-3-3.
 */
public class AlertActivity extends BaseActivity{
    @SuppressWarnings("unused")
    private static final String TAG = "AlertActivity";

    private Vibrator validator;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        setContentView(R.layout.activity_alert);
        setFinishOnTouchOutside(false);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                initValidator();
            }
        }, 300);
    }

    private void initValidator() {
        validator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
        long[] pattern = new long[]{400, 400, 400, 400};
        validator.vibrate(pattern, 0);
    }
}
